<template>
  <div>
    <el-card style="margin: 8px">
      <el-row>
        <h1>上海数据分中心固定资产详情</h1>
      </el-row>
      <el-row>
        <el-col :span="12" >
          <div style="margin-bottom: 10px">
            <span class="notes">分中心固定资产编号：</span> {{form.assetTagNumber}}
          </div>
          <span class="notes">当前状态：</span>
          <!-- {{form.status}} -->
          归档
        </el-col>
        <el-col :span="12" style="text-align: right">
          <el-button :size="size" type="primary"  v-print="printObj">打印</el-button>
          <!-- <el-button :size="size">导出</el-button> -->
          <el-button @click="returnGo" :size="size">返回</el-button>
        </el-col>
      </el-row>
    </el-card>
    <el-card style="margin: 8px">
      <!-- 固定资产详情 -->
      <AssetsInfo ref="AssetsInfo" id="printMe"></AssetsInfo>
    </el-card>
  </div>
</template>


<script>
  import { get } from '@/api/bizFixAssets/bizFixAssetsApi.js'

  import AssetsInfo from "./AssetsInfo";

export default {
  components: {AssetsInfo},
  data() {
    return {
      form: {},
      size: 'mini',
      id: undefined,
      loading: true,
      disable: true,
       printObj: {
        id: 'printMe', // 这里是要打印元素的ID
        popTitle: '&nbsp', // 打印的标题
        extraCss: '', // 打印可引入外部的一个 css 文件
        extraHead: '' // 打印头部文字
      },
    }
  },
  mounted() {
    this.id = this.$route.query.id;
    this.init();
  },
  methods: {
    init() {
      // 查询固定资产详情
      get(this.id).then(resp => {
        this.$refs.AssetsInfo.init(resp);
        this.form = resp;
      }).finally(() => {
        this.$refs.AssetsInfo.finish();
      })
    },
    // 返回
    returnGo() {
      this.$router.back(-1)
    },
  }
}
</script>

<style lang="scss">
.notes {
  font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
  font-style: normal;
  font-weight: 650;
  font-size: 13px;
  color: #999999;
}
</style>
